#!/usr/bin/python
# -*- coding: utf-8 -*-
# @author  : ganuoxun
# @description : 通用返回体


def success(data, msg):
    """
    返回成功

    Args:
        data: 返回内容
        msg: 返回消息
    Returns:
        response: 返回字典
    Raises:
    """
    return {'data': data, 'code': 200, 'msg': msg}


def error(code, msg):
    """
    返回失败

    Args:
        code: 错误状态码
        msg: 错误消息
    Returns:
        response: 返回字典
    Raises:
    """
    return {'code': code, 'msg': msg}


def err_info():
    """
    标准错误信息结构
    Returns:
    """
    return {
        "traceback": "",
        "err_msg": "",
        "处理到行": "",
        "已处理长度": "",
        "处理位置": ""
    }
